package com.yyx.app1.MedicationAssistant_function.Controls.MedicationAssistant_Activity_Control.TreeListView;

import android.app.Activity;
import android.content.Context;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yyx.app1.MedicationAssistant_function.Controls.MedicationAssistant_Activity_Control.Three_ListView.ItemDataType;
import com.yyx.app1.MyApp;
import com.yyx.app1.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by yuexing on 2015/9/1.
 */
@EViewGroup(R.layout.itemview_listview_medicationassistant_first_menu)
public class First_ItemView extends LinearLayout {
    private Context context;

    public First_ItemView(Context context) {
        super(context);
        this.context = context;
    }

    @ViewById
    TextView first_listview_text;

    @ViewById
    ImageView first_listview_ico;

    public void expand()
    {
        first_listview_ico.setImageBitmap(((MyApp)((Activity)context).getApplication()).getBaseDataManager().getResDrawable(R.drawable.tree2,first_listview_ico.getWidth(),first_listview_ico.getHeight()));
    }

    public void furl()
    {
        first_listview_ico.setImageBitmap(((MyApp)((Activity)context).getApplication()).getBaseDataManager().getResDrawable(R.drawable.tree,first_listview_ico.getWidth(),first_listview_ico.getHeight()));
    }

    public void bind(ItemDataType itemDataType)
    {
        first_listview_text.setText(itemDataType.itemName+"");
    }
}
